.pageLab {
  width: 100%;
  padding: 20px 0;
  font-family: sans-serif;

  .container {
    display: grid;
    grid-template-columns: minmax(768px, 1fr) 1fr;
    gap: 20px;
    margin: 0 auto;
    height: auto;
    align-items: flex-start;

    h1 {
      font-size: 24px;
      margin-bottom: 5px;
    }

    p {
      color: #666;
      margin-bottom: 20px;
    }

    .previewArea {
      min-width: 0;
      min-height: 400px;
      display: flex;
      flex-direction: column;
      gap: 10px;
      overflow: hidden;
      grid-column: 1;

      .imageContainer {
        box-shadow: 0 4px 15px rgba(0, 0, 0, 10%);
        border-radius: 8px;
        overflow: hidden;
        width: 100%;
        flex-grow: 1;
        min-height: 0;
        background: #f5f5f5;
        display: flex;
        align-items: center;
        justify-content: center;

        img {
          display: block;
          max-width: 100%;
          max-height: 70vh;
          width: auto;
          height: auto;
          object-fit: contain;
        }
      }
    }

    .controlsArea {
      grid-column: 2;
      background-color: #fff;
      border-radius: 12px;
      padding: 28px 24px 24px;
      display: flex;
      flex-direction: column;
      gap: 24px;
      box-sizing: border-box;
      min-width: 0;
      box-shadow: 0 2px 12px rgba(0, 0, 0, 4%);

      .btnRow {
        display: flex;
        gap: 16px;
        margin-bottom: 8px;
        width: 100%;
        flex-wrap: wrap;
        justify-content: flex-start;
        position: relative;
      }

      .uploadTip {
        position: absolute;
        top: 100%;
        left: 0;
        font-size: 12px;
        color: #666;
        margin-top: 4px;
      }

      .uploadBtn,
      .exportBtn {
        flex: none;
        min-width: 120px;
        padding: 12px 0;
        border: none;
        border-radius: 6px;
        font-weight: bold;
        font-size: 16px;
        text-align: center;
        cursor: pointer;
        transition: background-color 0.3s, box-shadow 0.2s;
        box-shadow: 0 1px 4px rgba(0, 0, 0, 4%);
        margin-bottom: 0;
        outline: none;

        &:active {
          box-shadow: 0 0 0 2px #4a90e233;
        }
      }

      .uploadBtn {
        background-color: #5cb85c;
        color: #fff;

        &:hover {
          background-color: #449d44;
        }

        input[type='file'] {
          display: none;
        }
      }

      .exportBtn {
        background-color: #4a90e2;
        color: white;

        &:hover {
          background-color: #357ab8;
        }
      }

      .styleSelector {
        display: flex;
        flex-direction: column;

        .styleTabs {
          display: flex;
          border-bottom: 1px solid #eee;

          .styleTab {
            padding: 12px 16px;
            font-size: 15px;
            font-weight: 500;
            color: #666;
            cursor: pointer;
            transition: all 0.3s ease;
            border-radius: 6px 6px 0 0;

            &:hover {
              color: #4a90e2;
              background: #f3f8ff;
            }

            &.activeTab {
              color: #4a90e2;
              border-bottom: 2px solid #4a90e2;
              background: #f3f8ff;
            }
          }
        }

        .tabContent {
          padding: 16px 0 0;
          overflow-x: auto;

          label {
            font-weight: bold;
            font-size: 13px;
            color: #333;
          }

          .watermarkControls,
          .exifControls,
          .appearanceControls {
            display: flex;
            flex-wrap: wrap;
            gap: 16px 24px;

            > div {
              display: flex;
              flex-direction: column;
              gap: 6px;
              min-width: 120px;
              max-width: 220px;

              label {
                font-weight: bold;
                font-size: 13px;
                color: #333;
              }

              input[type='text'],
              select {
                padding: 7px 10px;
                border: 1px solid #ddd;
                border-radius: 4px;
                font-size: 14px;
                background: #fafbfc;
              }
            }
          }
        }
      }
    }
  }
}

/* 背景颜色选择器专用样式 */
.watermarkStyleSelector {
  display: flex;
  // flex-direction: row;
  // flex-wrap: wrap;
  flex-flow: row wrap;
  gap: 8px;
  margin-top: 5px;
}

.sectionBlock {
  background: #f8fafd;
  border-radius: 10px;
  box-shadow: 0 1px 6px rgba(80, 120, 200, 4%);
  padding: 18px 18px 10px;
  margin-bottom: 22px;
}

.sectionTitle {
  font-size: 17px;
  font-weight: 600;
  color: #2563eb;
  margin-bottom: 12px;
  letter-spacing: 1px;
}

/* 媒体查询 */
@media (max-width: 1520px) {
  .pageLab .container {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
    gap: 24px;
  }

  .pageLab .container .previewArea {
    min-width: 0;
    width: 100%;
    grid-column: 1;
    grid-row: 1;
  }

  .pageLab .container .controlsArea {
    grid-column: 1;
    grid-row: 2;
    width: 100%;
    min-width: 0;
    padding: 20px;
  }
}

@media (max-width: 750px) {
  .pageLab {
    padding: 10px;

    .container {
      grid-template-columns: 1fr;
      grid-template-rows: auto auto;
      gap: 12px;
      margin: 0;

      .previewArea {
        min-width: 0;
        width: 100%;
        grid-column: 1;
        grid-row: 1;
        min-height: 220px;

        .imageContainer {
          min-height: 120px;
        }
      }

      .controlsArea {
        grid-column: 1;
        grid-row: 2;
        width: 100%;
        min-width: 0;
        padding: 12px 4px;
        border-radius: 8px;
        gap: 12px;

        .btnRow {
          gap: 8px;
        }

        .uploadBtn,
        .exportBtn {
          min-width: 80px;
          font-size: 15px;
          padding: 10px 0;
        }

        .styleSelector .tabContent {
          padding: 8px 0 0;
        }
      }
    }
  }
}
